#ifndef __GfxDriver_WGL_WGLIndexBuffer_h__
#define __GfxDriver_WGL_WGLIndexBuffer_h__

#include "GfxDriver/IndexBuffer.h"
#include "GfxDriver/WGL/GLInclude.h"

namespace Orca {

	class GfxDriver;

	//--------------------------------------------------------------------------
	class WGLIndexBuffer : public IndexBuffer {

	public:
		static WGLIndexBuffer* create(
			GfxDriver *gfxDriver,
			uint32 sizeInBytes,
			bool staticUsage);

		WGLIndexBuffer(
			GfxDriver *gfxDriver,
			uint32 sizeInBytes,
			GLuint glHandle,
			GLenum glUsage);

		virtual ~WGLIndexBuffer();

		virtual uint32 getSizeInBytes();
		virtual unsigned int getAPIHandle();

		virtual uint8* requestUpload(bool discardCurrent);
		virtual void uploadToGPU();

	private:
		GfxDriver *mGfxDriver;
		uint32 mSizeInBytes;
		GLuint mGLHandle;
		GLenum mGLUsage;
	};

}

#endif	// __GfxDriver_WGL_WGLIndexBuffer_h__